//
//  NetworkManager.h
//  GodCoin
//
//  Created by Xiaohan on 2018/6/5.
//  Copyright © 2018年 xiaohan. All rights reserved.
//

#import "PPNetworkHelper.h"
#import "XHBaseModel.h"
///接口参数加密
@interface NetworkManager : PPNetworkHelper
#pragma mark - GET请求自动缓存
+ (__kindof NSURLSessionTask *)GET:(NSString *)URL
                        parameters:(id)parameters
                     responseCache:(PPHttpRequestCache)responseCache
                           success:(PPHttpRequestSuccess)success
                           failure:(PPHttpRequestFailed)failure;

#pragma mark - POST请求自动缓存
+ (__kindof NSURLSessionTask *)POST:(NSString *)URL
                parameters:(id)parameters
            responseCache:(PPHttpRequestCache)responseCache
                   success:(PPHttpRequestSuccess)success
                   failure:(PPHttpRequestFailed)failure;

#pragma mark - PUT请求无缓存
+ (__kindof NSURLSessionTask *)PUT:(NSString *)URL
              parameters:(id)parameters
                 success:(PPHttpRequestSuccess)success
                 failure:(PPHttpRequestFailed)failure;

#pragma mark - DELETE请求无缓存
+ (__kindof NSURLSessionTask *)DELETE:(NSString *)URL
                        parameters:(id)parameters
                           success:(PPHttpRequestSuccess)success
                           failure:(PPHttpRequestFailed)failure;
#pragma mark - 上传图片
+ (__kindof NSURLSessionTask*)uploadImagesWithURL:(NSString *)URL
                                       parameters:(id)parameters
                                             name:(NSString *)name
                                           images:(NSArray<UIImage *> *)images
                                        fileNames:(NSArray<NSString *> *)fileNames
                                       imageScale:(CGFloat)imageScale
                                        imageType:(NSString *)imageType
                                         progress:(PPHttpProgress)progress
                                          success:(PPHttpRequestSuccess)success
                                          failure:(PPHttpRequestFailed)failure;
#pragma mark - 上传文件
+ (__kindof NSURLSessionTask*)uploadFileWithURL:(NSString *)URL
                                     parameters:(id)parameters
                                           name:(NSString *)name
                                       filePath:(NSString *)filePath
                                       progress:(PPHttpProgress)progress
                                        success:(PPHttpRequestSuccess)success
                                        failure:(PPHttpRequestFailed)failure;
#pragma mark - 下载二进制流文件
+ (__kindof NSURLSessionTask*)downloadFileStreamWithHTTPMethod:(NSString*)HTTPMethod
                                                           Url:(NSString*)urlStr
                                                       success:(PPHttpRequestSuccess)success;
///加密参数
+ (NSDictionary *)creatSignWithParameter:(NSDictionary*)param;
///得到get URl
+ (NSString *)creatGETUrl:(NSString*)urlStr parameter:(NSDictionary*)param;
@end
